import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/login/index.vue'
import LayoutView from '../views/dashboard/LayoutPage/index.vue'
import HomeView from '@/views/dashboard/HomePage/index.vue'
import RecommendView from '../views/dashboard/RecommendPage/index.vue'
import SearchView from '../views/dashboard/SearchPage/index.vue'
import CompanyView from '@/views/dashboard/CompanyPage/index.vue'
import AppView from '@/views/dashboard/AppPage/index.vue'
import JobDetailView from '@/views/dashboard/JobDetailPage/index.vue'
import Inform from '@/views/dashboard/InformPage/index.vue'

import enterpriseRouter from '@/router/modules/enterprise'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: '/',
      name: 'layout',
      component: LayoutView,
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          component: HomeView
        },
        {
          path: '/recommend',
          name: 'recommend',
          component: RecommendView
        },
        {
          path: '/search',
          name: 'search',
          component: SearchView
        },
        {
          path: '/company',
          name: 'company',
          component: CompanyView
        },
        {
          path: '/app',
          name: 'app',
          component: AppView
        },
        {
          path: '/jobDetail',
          name: 'jobDetail',
          component: JobDetailView
        },
        {
          path: '/inform',
          name: 'inform',
          component: Inform
        }
      ]
    },
    enterpriseRouter
  ]
})

export default router
